package core.dao.mybatis;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import core.base.exception.AppBizException;
import core.dao.CrudDao;


public interface GenericDao<T, I extends Serializable, Q> extends CrudDao<T, I> {

	public List<T> query(Q cond, long firstResult, long maxResults);

	public T getFirst(Q cond);

	public T getFirstForUpdate(Q cond);

	public List<T> loadForUpdate(Q cond);

	public void iterate(Q cond, IterateCallback callback) throws AppBizException;

	public void quickIterate(Q cond, IterateCallback callback) throws AppBizException;

	public long count(Q cond);

	public BigDecimal simpleSum(Q cond, String propertyName);

	public List<BigDecimal> sum(Q cond, String[] propertyNames);

	public QueryResult<T> queryForResult(Q cond, long firstResult, long maxResults);

	public int bulkUpdate(Q cond, Map<String, Object> values);
}
